#include <iostream>

using namespace std;

int main()
{
	int n; cin >> n;
	int ret = n;
	for (int i = 1; i <= n; i++)
	{
		int x; cin >> x;
		if (x == 1) ret--;
	}
	cout << ret << endl;
	return 0;
}